<?php 	
		$cate=new \Common\Model\Cate;
		$topCate=$cate->where('pid=0')->get();
		$Cate=$cate->get();
		$cateTwo = $cate->where("pid=0")->get();
		foreach ($cateTwo as $k => $v) {
			$cateData[$k]['son'] = $cate->where("pid={$v['cid']}")->limit(1)->get();

		}
 ?>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/style.css"/>
		<link rel="shortcut icon" href="./Public/Home/images/favicon.ico"/>
		<script src="./Public/Home/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="./Public/Home/js/js.js"></script>
    	<script type="text/javascript">
    		$(function(){
    			$(".left_nav").hover(function(){
					
					$(".list_middle").css({display:"block"});
				},function(){
					$(".list_middle").css({display:"none"});
			
				});
    		})
    	</script>
	</head>
	<body>
		<div id="top">
			<div class="comWidth">
				<ul class="left fl">
					<li class="l1"><a href="javascript:;">华为官网</a></li>
					<li><a href="javascript:;">华为荣耀</a></li>
					<li><a href="javascript:;">软件应用</a></li>
					<li><a href="javascript:;">花粉俱乐部</a></li>
					<li><a href="javascript:;">Select Region</a></li>
				</ul>
				<ul class="right fr">
					<li class="l1">
						<?php if(isset($_SESSION['uid'])){?>
                
						<span>欢迎，</span><a href="javascript:;"><?php echo $_SESSION['useremail']?></a>
						<a href="<?php echo U('Login/out')?>">退出</a>
						<?php }else{?>
						<a href="<?php echo U('Login/index')?>">登录</a>
						<a href="<?php echo U('Register/index')?>">注册</a>
						
               <?php }?>
					</li>
						<li><a href="javascript:;">我的订单</a></li>
						<li><a href="javascript:;">V码(优购码)</a></li>
						<li><a href="javascript:;">手机版</a></li>
						<li class="l5"><a href="javascript:;">网站导航</a><s></s></li>
					
				</ul>
			</div>
		</div>
		<!--顶部结束-->
		<div id="tpad" class="comWidth"><a href="javascript:;"><img src="./Public/Home/images/tpad.jpg"/></a></div>
		<div id="header" class="comWidth">
			<div class="logo fl">
				<a href="javascript:;">
					<img src="./Public/Home/images/newlogo.png" alt="" />
				</a>
			</div>
			<div class="seach fl" style="margin-right: 30px;">
				<form action="" method="post">
					<input type="text" name="" id="" value="" placeholder="荣耀6 plus" class="text"/><input type="submit" value="搜索" class="btn"/>
				</form>
				<ul>
					<li class="l1">热门搜索：</li>
					<li><a href="javascript:;">5X </a></li>
					<li><a href="javascript:;">荣耀7</a></li>
					<li><a href="javascript:;">Mate S</a></li>
					<li><a href="javascript:;">4A</a></li>
					<li><a href="javascript:;">Mate 8</a></li>
					<li><a href="javascript:;"> 热门配件 </a></li>
				</ul>
			</div>
			<div class="car">
				<div class="car_box fl"><a href="javascript:;" class="a1">我的商城</a><s></s></div>
				<div class="car_box fr"><a href="javascript:;" class="a2">我的购物车</a><s></s></div>
			</div>
			<div class="QR_code fr">
				<ul>
					<li>
						<a href="javascript:;"><img src="./Public/Home/images/qrcode_vmall_app01.png" alt="vmall" /></a>
						<p>扫码下载客户端</p>
					</li>
					<li style="display: none;">
						<a href="javascript:;"><img src="./Public/Home/images/img67.png" alt="vmall_weixin"/></a>
						<p>微信扫码关注我们</p>
					</li>
				</ul>
			</div>

		</div>
		<!--header结束-->
		<div id="nav">
			<div class="comWidth">
				<div class="left_nav list_nav">
					<h2>全部商品</h2>
					
					<div class="midlle list_middle">
						<?php foreach ($topCate as $key=>$value){?>
						<dl class="">
							
							<dt><a href="<?php echo U('List/index',array('cid'=>$value['cid']))?>"><?php echo $value['cname']?></a></dt>
							<?php foreach ($Cate as $k=>$v){?>
						
							<?php if($value['cid']==$v['pid']){?>
                
							<dd><a href="<?php echo U('List/index',array('cid'=>$v['cid']))?>"><?php echo $v['cname']?></a></dd>
							
							
               <?php }?>
							<?php }?>
								
						</dl>
						<?php }?>
					</div>
					
				</div>
				<ul class="fl">
					<li class="active"><a href="<?php echo U('Index/index')?>">首页</a></li>
					<?php foreach ($cateData as $key=>$value){?>
						<?php foreach ($value['son'] as $kk=>$vv){?>
					<li><a href="<?php echo U('List/index',array('cid'=>$vv['cid']))?>"><?php echo $vv['cname']?></a></li>
						<?php }?>
					<?php }?>
					
				</ul>
			</div>
			
		</div>
		<!--nav结束-->